function [P,iter,err]=newdim(F,JF,P,epsilon,delta,max1)
% **** **** **** **** **** ****input parameter*** *** **** *** *** *** *****
%F: Receives the vector function to be represented from the name ofM_file
% JF: Receives the matrix function(Jccobian matrix) to be represented from the name%
ofM_ file.
% P:initial approximation to the solution. Pis a known column vector
% epsilon: the torlerance for p
% delta:the torlerance for F(p)
% max1:the maximum number ofiterations
% * *** **** **** **** **** **output parameter*** **** **** **** **** **** **** *****
%P:final approximation to the solution
%iter:the number ofiterations required
%err:the error estimate for P
%* *** *** ***To begin programming funcion body code*** **** **** **** ****
Y=feval(F,P);
%Y is a row vector
for k=1:max1 
J=feval(JF,P);
Q=P-(J\Y');
Z=feval(F,Q);
err=norm(Q-P);
relerr=err/(norm(Q)+eps);
P=Q;
Y=Z;
iter=k;
if (err<epsilon )|(relerr<epsilon)|(abs(Y )<delta)
break
end
end
